import request from '@/utils/request'

// 获取apiTOKEN
export function userGetApiToken(params) {
  return request({
    url: '/server/user/getApiToken',
    method: 'get',
    params
  })
}

// 被试信息补全
export function seckCompleteInfo(params) {
  return request({
    url: '/server/seck/completeInfo',
    method: 'get',
    params
  })
}

// 添加被试
export function testedAddBaseInfo(data) {
  return request({
    url: '/server/tested/add/baseInfo',
    method: 'post',
    data
  })
}

// 根据题组获取题目
export function seckGetQuestions(params) {
  return request({
    url: '/server/seck/getQuestions',
    method: 'get',
    params
  })
}

// 添加赛克测评记录
export function seckAddAssessRecord(data) {
  return request({
    url: '/server/seck/addAssessRecord',
    method: 'post',
    data
  })
}

// 获取被试的赛克报告列表(单人)
export function seckGetPsychReport(params) {
  return request({
    url: '/server/seck/getPsychReport',
    method: 'get',
    params
  })
}

// 获取被试赛克列表(多人)
export function seckGetPsychTested(params) {
  return request({
    url: '/server/seck/getPsychTested',
    method: 'get',
    params
  })
}

// 获取详细报告
export function seckGetReportById(params) {
  return request({
    url: '/server/seck/getReportById',
    method: 'get',
    params
  })
}

// 编辑被试
export function testedUpdateBaseInfo(data) {
  return request({
    url: '/server/tested/update/baseInfo',
    method: 'post',
    data
  })
}

// 编辑赛克评测记录
export function seckUpdateAssessRecord(data) {
  return request({
    url: '/server/seck/updateAssessRecord',
    method: 'post',
    data
  })
}
// ================================2023/11/18版本=====================================
// 新-获取档案列表
export function serverSeckGetFilesList(params) {
  return request({
    url: '/server/seck/getFilesList',
    method: 'get',
    params
  })
}
// 新-获取弹出层的列表
export function serverSeckGetFilesListByParentId(params) {
  return request({
    url: '/server/seck/getFilesListByParentId',
    method: 'get',
    params
  })
}
// 新-获取详细的答题卡内容
export function serverSeckGetDetail(params) {
  return request({
    url: '/server/seck/getDetail',
    method: 'get',
    params
  })
}
// 新-新增档案
export function serverSeckAdd(data) {
  return request({
    url: '/server/seck/add',
    method: 'post',
    data
  })
}
// 新-更新
export function serverSeckUpdate(data) {
  return request({
    url: '/server/seck/update',
    method: 'post',
    data
  })
}
// 新-批量新增档案
export function serverSeckAddList(token,data) {
  return request({
    url: '/server/seck/addList?WAIMS_TOKEN=' + token,
    method: 'post',
    headers: { 'content-type': 'application/json' },
    data: data
  })
}
// 新-批量新增档案
export function serverSeckUpdateList(token,data) {
  return request({
    url: '/server/seck/updateList?WAIMS_TOKEN=' + token,
    method: 'post',
    headers: { 'content-type': 'application/json' },
    data: data
  })
}
// 新-获取例数
export function serverSeckGetBalance(params) {
  return request({
    url: '/server/seck/getBalance',
    method: 'get',
    params
  })
}
// 新-下载报告
export function serverSeckGetReport(params) {
  return request({
    url: '/server/seck/getReport',
    method: 'get',
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
    },
    params
  })
}